<template>
    <div>
      <div class="header">
        <div>
        <div class="left">
          <img src="../assets/06.png" alt="">
          <span class="a">首页</span>
          <span class="z">即将售完</span>
        </div>
        <div class="right">
          <span><i class="fa fa-truck"></i> 全国包邮</span>
          <span><i class="fa fa-gavel"></i> 正品保证</span>
          <span><i class=" fa fa-yen"></i> 超值低价</span>
        </div>
      </div>
      </div>
      <div class="tu">
        <section>
          <img src="https://s10.mogucdn.com/mlcdn/c45406/190426_6ic10d4fh016eiib37kfh727khg5l_190x180.png_999x999.v1c0.100.webp" alt="">
          <img src="https://s10.mogucdn.com/mlcdn/c45406/190426_8eb1ji1k38l88d8dha6j0fhgjkh17_190x180.jpg_999x999.v1c0.100.webp" alt="">
        </section>
      </div>
      <main>
        <div class="top">
          <ul>
            <li><span>昨日19:00<small>已开抢</small></span></li>
            <li><span>昨日22:00<small>已开抢</small></span></li>
            <li><span>今日00:00<small>已开抢</small></span></li>
            <li><span>今日10:00<small>已开抢</small></span></li>
            <li class="now"><span>今日13:00<small>快抢中</small></span></li>
            <li><span>今日16:00<small>即将开抢</small></span></li>
            <li><span>今日19:00<small>即将开抢</small></span></li>
            <li><span>今日22:00<small>即将开抢</small></span></li>
            <li><span>今日00:00<small>即将开抢</small></span></li>
          </ul>
        </div>
        <div class="bottom">
          <div class="left">
            <div>
              <h3>限时限量 低价疯抢</h3>
              <section>距离结束还有
                <span>00</span>:
                <span>13</span>:
                <span>48</span>
              </section>
            </div>
            <div class="xia">
              <ul>
                <li v-for="(aa,index) in show" :key="'ins' + index" >
                  <img :src="aa.tu_url" alt="">
                  <div>
                    <h3>{{aa.name}}</h3>
                    <p class="p1"><span>快抢价</span><span>￥{{aa.price}}</span><span>￥{{aa.unprice}}</span></p>
                    <p class="p2">已抢{{aa.quantity}}件</p>
                    <p class="p3">立即抢购</p>
                    <span>仅剩{{aa.have}}件</span>
                  </div>
                </li>
              </ul>
            </div>
          </div>
          <div class="right">
            <img src="../assets/07.png" alt="">
            <ul>
              <li>即将售完</li>
              <li>返场</li>
              <li>品牌</li>
              <li>上装</li>
              <li>裙裤</li>
              <li>套装</li>
              <li>美妆</li>
              <li>个护</li>
              <li>鞋包</li>
              <li>其他</li>
            </ul>
            <img src="../assets/08.png" alt="" class="z">
            <p>手机抢购，快人一步</p>
          </div>
        </div>
        <div class="zxia">
          <span>上一场</span>
          <span>下一场</span>
        </div>
      </main>
      <!--<div v-for="aa in show">-->
        <!--<img :src="aa.tu_url" alt="">-->
        <!--{{aa.price}}-->
      <!--</div>-->

    </div>
</template>

<script>
  import mix from '../mix'
  import axios from 'axios'
    export default {
        data: function () {
            return {
              activeName: 'first',
              show:[],
              isLoadMore:true
            }
        },
      methods: {
        handleClick(tab, event) {
          console.log(tab, event);
        }
      },
      mounted(){
        this.show = this.show.concat( mix.data );
//            this.getShops();


        // 加载更多的触发条件：当滚动条滚动至底部
        console.log( document.body );
        window.onscroll = function(ev){
//              console.log( document.body.scrollHeight )
          // 获取屏幕高度
          let height = window.innerHeight;
          // 滚动的距离
          let scrHeight = ev.pageY;
          // 内容高度
          let conHeight = document.body.scrollHeight;

          if( scrHeight + height > conHeight - 550 ){
            if( this.isLoadMore ){
              this.loadMore();
//                        this.loadMore( )
              this.isLoadMore = false;
            }
          }
        }.bind(this)
      },
      methods:{

        loadMore(){
          console.log('加载更多');

          this.show = this.show.concat( mix.data );


        }
      }
    }
</script>

<style scoped>

  .header{
    background:#ff4466 ;
  }
  .header>div{
    width: 70%;
    margin: 0 auto;
    overflow: hidden;

    color: #fff;
    font-size: 14px;
  }
  .header .left{
    float: left;
  }
  .header .left img{
    width: 50px;
    height: 30px;
    margin:6px;
    cursor: pointer;
  }
  .header .left span{
    position: relative;
     top: -14px;
    margin: 0 30px;
    cursor: pointer;
  }
  .header .left .a{
    border-bottom: solid 3px #fff;
    padding-bottom: 3px;
  }
  .header .left .z{
    padding-bottom: 3px;
  }
  .header .left .z:hover{
    border-bottom: solid 3px #fff;
    /*padding-bottom: 3px;*/
  }
  .header .right{
    float: right;
    margin-top: 8px;

  }
  .header .right span{
    margin-right: 20px;
  }
  .header .right i{
    display: inline-block;
    width: 30px;
    height:30px;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    font-size: 16px;
    padding-top: 7px;
  }
  .tu{
    overflow: hidden;
    width: 70%;
    margin: 0 auto;
    padding:  20px 0;
  }
  .tu section{
    float: right;
    width:230px ;
    height: 400px;
    border: solid 1px #ccc;
  }
  .tu section img{
    margin-top: 10px;
    width: 90%;
    /*margin: 0 auto;*/
    height: 180px;
  }
  main{
    width: 70%;
    margin: 0 auto;
  }
  main .top{
    background: #000;
    color:#fff;
  }
  main .top ul{
    overflow: hidden;
  }
  main .top li{
    float: left;
    width:11% ;
    /*height: 50px;*/
    text-align: center;
  }
  main .top .now{
    background:#fdcb00 ;
    color: #000;
  }
  main .top .now small{
    font-weight: 600;
  }
  main .top li span{
    margin:10px 0;
    font-size: 18px;
    display: inline-block;
    width: 120px;
  }
  main .top li span small{
    display: inline-block;
    font-size: 14px;
    width: 120px;
    /*margin:20px 0;*/
  }
  main .bottom{
    margin-top: 10px;
    overflow: hidden;
  }
  main .bottom .left{
    overflow: hidden;
    width: 80%;
    float: left;
  }
  main .bottom .left h3{
    float: left;
    font-weight: normal;
  }
  main .bottom .left section{
    float: right;
  }
  main .bottom .left section span{
    background:#000 ;
    color: #fff;
    display: inline-block;
    padding: 10px;
    border-radius: 5px;
  }
  main .bottom .left .xia{
    margin-top: 50px;
  }
  main .bottom .left ul{
    overflow: hidden;
  }
  main .bottom .left ul li{
    width: 48%;
    float: left;
    border: solid 1px #ccc;
    overflow: hidden;
    text-align: left;
    margin: 1%;
  }
  main .bottom .left ul li img{
    margin: 20px;
    float: left;
    width: 40%;
  }
  main .bottom .left ul li div{
    float: left;
    margin-top: 20px;
    overflow: hidden;
  }
  main .bottom .left ul li div h3{
    padding-bottom: 10px;
    margin-bottom: 15px;
    border-bottom: dashed 1px #ccc;

  }
  main .bottom .left ul li div .p1{
    font-size: 14px;

  }
  main .bottom .left ul li div .p1 span:first-child{
    font-size: 14px;
  }
  main .bottom .left ul li div .p1 span:nth-child(2){
    color: red;
    font-size: 22px;
  }
  main .bottom .left ul li div .p1 span:last-child{
    color: #999999;
    text-decoration: line-through;
    margin-left: 5px;
  }
  main .bottom .left ul li div .p2{
    color: #999999;
    font-size: 14px;
    margin: 20px 0;
  }
  main .bottom .left ul li div .p3{
    display: block;
    width: 100px;
    height: 30px;
    background: #ff4163;
    border-radius: 3px;
    padding: 3px 16px;
    color: #fff;
    float: left;
    cursor: pointer;
  }
  main .bottom .left ul li div>span{
    float: left;
    color: #999999;
    font-size: 14px;
    margin: 5px 20px;
  }
  main .zxia{
    margin-top: 20px;
  }
  main .zxia span{
    display: inline-block;
    width: 150px;
    height: 40px;
    background:#fdcb00 ;
    padding-top: 8px;
    cursor: pointer;
    margin: 20px;
  }
  main .bottom .right{
    border: solid 1px #ccc;
    float: right;
    width: 18%;
  }
  main .bottom .right ul{
    width: 70%;
    margin: 0 auto;
      overflow: hidden;
  }
  main .bottom .right li{
    float: left;
    margin: 20px;
    font-size: 14px;
    font-weight: 600;
  }
  main .bottom .right li:first-child{
    margin-left: 5px;
  }
  main .bottom .right li:nth-child(2){
    margin-left: 8px;
  }
  main .bottom .right .z{
    width: 80%;
    margin: 10px 0;
  }
  main .bottom .right p{
    font-size: 12px;
    color: #666666;
    margin: 20px 0;
  }
</style>
